home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / DJLSR106.ARJ / GETW.C < prev    next >
C/C++ Source or Header  |  1992-03-02  |  569b  |  27 lines

  1. /* This is file GETW.C */
  2. /* This file may have been modified by DJ Delorie (Jan 1991).  If so,
  3. ** these modifications are Coyright (C) 1991 DJ Delorie, 24 Kirsten Ave,
  4. ** Rochester NH, 03867-2954, USA.
  5. */
  6.  
  7. #if defined(LIBC_SCCS) && !defined(lint)
  8. static char sccsid[] = "@(#)getw.c    5.2 (Berkeley) 3/9/86";
  9. #endif LIBC_SCCS and not lint
  10.  
  11. #include <stdio.h>
  12.  
  13. getw(iop)
  14. register FILE *iop;
  15. {
  16.     register i;
  17.     register char *p;
  18.     int w;
  19.  
  20.     p = (char *)&w;
  21.     for (i=sizeof(int); --i>=0;)
  22.         *p++ = getc(iop);
  23.     if (feof(iop))
  24.         return(EOF);
  25.     return(w);
  26. }
  27.